package com.example.partyfee.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * 系统启动时打印Swagger文档地址
 */
@Slf4j
@Component
public class SwaggerInitializer implements CommandLineRunner {

    @Value("${server.port:8080}")
    private String serverPort;

    @Override
    public void run(String... args) {
        log.info("=============================================");
        log.info("Swagger文档地址: http://localhost:{}/api/swagger-ui.html", serverPort);
        log.info("Swagger接口文档: http://localhost:{}/api/v3/api-docs", serverPort);
        log.info("=============================================");
    }
} 